package com.funny.learning.english.model;

import org.json.JSONArray;
import org.json.JSONObject;

import com.funny.learning.english.api.Define;

public class SubTopicEntity {
	private String course;
	private String iid;
	private String name;
	private String pID;
	private String slug;
	private String url;
	private String id;
	private JSONArray jArrGameType;
	
//	"subtopics": [
//{
//"course": "547edc8178a23c373037f8e8",
//"iid": 15,
//"name": "Cá biển",
//"pid": "54631490f62ac449598b4569",
//"slug": "ca-bien",
//"url": "54c9a49e78a23c962175902a.jpg",
//"id": "54c9a4aa78a23c011b75902b",
//"games": [
//  {
//    "iid": 6,
//    "name": "từ vựng",
//    "slug": "tu-vung",
//    "url": "546cbefa78a23cf3186d9610.jpg",
//    "id": "54631a2af62ac42c658b4568"
//  },
//  {
//    "iid": 5,
//    "name": "Viết từ",
//    "slug": "viet-tu",
//    "url": "546cbf0778a23cf6186d9610.png",
//    "id": "54631a01f62ac4d2618b4569"
//  },
//  {
//    "iid": 4,
//    "name": "chọn ảnh",
//    "slug": "chon-anh",
//    "url": "546cbf1578a23cf3186d9611.png",
//    "id": "546319f5f62ac4d2618b4568"
//  },
//  {
//    "iid": 3,
//    "name": "Nghe",
//    "slug": "nghe",
//    "url": "546cbf1e78a23c07186d9615.png",
//    "id": "546319e7f62ac4d2618b4567"
//  },
//  {
//    "iid": 1,
//    "name": "chọn từ",
//    "slug": "chon-tu",
//    "url": "547edf9f78a23cee3837f8e8.png",
//    "id": "547edfb978a23cfb3837f8e8"
//  },
//  {
//    "iid": 2,
//    "name": "nối từ",
//    "slug": "noi-tu",
//    "url": "547edfc178a23cc93837f8eb.jpg",
//    "id": "547edfc778a23ccb3837f8e8"
//  }
//]
	
	public SubTopicEntity() {
	}
	public SubTopicEntity(JSONObject jsonObject) {
//		private String course;
//		private String iid;
//		private String name;
//		private String pID;
//		private String slug;
//		private String url;
//		private String id;
//		private JSONArray jArrGameType;
		//"course": "547edc8178a23c373037f8e8",
		//"iid": 15,
		//"name": "Cá biển",
		//"pid": "54631490f62ac449598b4569",
		//"slug": "ca-bien",
		//"url": "54c9a49e78a23c962175902a.jpg",
		//"id": "54c9a4aa78a23c011b75902b",
		//"games": [
		course = jsonObject.optString("course", "");
		iid = jsonObject.optString("iid", "");
		name = jsonObject.optString("name", "");
		pID = jsonObject.optString("pid", "");
		slug = jsonObject.optString("slug", "");
		url = jsonObject.optString("url", "");
		id = jsonObject.optString("id", "");
		
		jArrGameType = jsonObject.optJSONArray("games");
	}

	public String getCourse() {
		return course;
	}

	public void setCourse(String course) {
		this.course = course;
	}

	public String getIid() {
		return iid;
	}

	public void setIid(String iid) {
		this.iid = iid;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getpID() {
		return pID;
	}

	public void setpID(String pID) {
		this.pID = pID;
	}

	public String getSlug() {
		return slug;
	}

	public void setSlug(String slug) {
		this.slug = slug;
	}

	public String getUrl() {
		return Define.ROOT_IMAGE + url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}
	public JSONArray getjArrGameType() {
		return jArrGameType;
	}
	public void setjArrGameType(JSONArray jArrGameType) {
		this.jArrGameType = jArrGameType;
	}

	
	
}
